package com.miyake.client;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.miyake.client.community.CommunityProperty;
import com.miyake.client.datamanage.plugin.PluginProperty;
import com.miyake.client.profile.UserProperty;
import com.miyake.client.tools.ImageListElement;

@RemoteServiceRelativePath("DoctorsUserService")
public interface DoctorsUserService extends RemoteService {
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static DoctorsUserServiceAsync instance;
		public static DoctorsUserServiceAsync getInstance(){
			if (instance == null) {
				instance = GWT.create(DoctorsUserService.class);
			}
			return instance;
		}
	}
	LoginInfo login(String requestUri);
	
	// Community
	String createCommunity(String name, Integer type);
	List<CommunityProperty> getAllCommunityList(Integer type);
	List<ImageListElement> getCommunityList(String key, Integer type);
	void deleteCommunity(String key);
	
	// User
	void addUser(String email);
	void deleteUser(String key);
	Boolean isAdministrator();
	UserProperty getUser(String key);
	UserProperty getMyProperty();
	void updateMyProperty(Integer row, String value);
	List<ImageListElement> getFriendList(String key);
	List<ImageListElement> getAllUsers();
	List<ImageListElement> getFaceImages(String key);
	void setFaceImage(String key, Integer number);
	void addFriend(String friend);
	void removeFriend(String key);
	void removeFaceImage(String key);
	
	// Plugin
	void addAnalysisPlugin(String key); // Analysis
	void removeAnalysisPlugin(String key);
	List<PluginProperty> getAnalysisPluginList();
	void addFilePlugin(String key); // File
	void removeFilePlugin(String key);
	List<PluginProperty> getFilePluginList();
	void addChartPlugin(String key); // Chart
	void removeChartPlugin(String key);
	List<PluginProperty> getChartPluginList();
}
